//Copyright (C) 2012 Chirila Alexandru
//This file is part of Mirror FTP
//
//Mirror FTP is free software: you can redistribute it and/or modify
//it under the terms of the GNU General Public License as published by
//the Free Software Foundation, either version 3 of the License, or
//(at your option) any later version.
//
//Mirror FTP is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//GNU General Public License for more details.
//
//You should have received a copy of the GNU General Public License
//along with Mirror FTP.  If not, see <http://www.gnu.org/licenses/>.

#include "model.h"

model::model() {
	obs=NULL;
}

model::~model() {}

void model::notify(string x){
	///Notifies the view to append x to status Gtk::TextView
	if(obs!=NULL) obs->append_status(x);
}
void model::notify_f(string x){
	///Notifies the view set the displaed downloading file to x
	if(obs!=NULL) obs->file_progress(x);
}
void model::notify(long long time,int speed,long long eta){
	///Notifies the view to display the time,speed,
	///estimated time of the current download and to pulse the progress bar

	if(obs!=NULL) obs->pulse_progress(time,speed,eta);
}
void model::notify(){
	///Notifies the view to reset the progress bar

	if(obs!=NULL) obs->reset_progress();
}
